package com.hoshiicloud.payment.feign.fallback;

import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.hoshiicloud.payment.feign.IdGeneratorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author Mr.wu
 * @title: HystrixIdGeneratorFeignFallback
 * @projectName hoshiicloud-payment
 * @description:HystrixIdGeneratorFeignFallback
 * @since 2019-05-13
 */
@Slf4j
@Component
public class HystrixIdGeneratorFeignFallback implements IdGeneratorService {

    @Override
    public String queryGeneratorId() {
        log.warn("id服务触发fallback,使用本地雪花算法");
        return IdWorker.getIdStr();
    }
}
